<extend name="public@base"/>
block(name='main')
    .wrap
        ul.nav.nav-tabs(role="tablist")
            li.nav-item: a.nav-link(href="{:url('mailer/index')}") {:lang('ADMIN_MAILER_INDEX')}
            li.nav-item: a.nav-link.active(href='#', data-toggle='tab') 数字验证码邮件模板
        form.form-horizontal.js-ajax-form.margin-top-20(method='post', role='form', action="{:url('admin/mailer/templatePost')}")
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-title')
                    span.form-required
                    | {:lang('EMAIL_SUBJECT')}
                .col-8.col-lg-6
                    input#input-title.form-control(type='text', name='subject', value="{$subject|default=''}")
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-title')
                    span.form-required
                    | {:lang('EMAIL_TEMPLATE')}
                .col-8.col-lg-6
                    script#content(type='text/plain', name='template').
                        {$template|default=""|htmlspecialchars_decode}
                    literal
                        span.text-warning
                            | 请用{$code}代替数字验证码，{$username}代替用户名
            .form-group.form-row
                .col-auto.offset-lg-2
                    input(type='hidden', name='template_key', value='verification_code')
                    button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('SAVE')}
block(name='bottom-script')
    script.
        //编辑器路径定义
        var editorURL = GV.WEB_ROOT;
    script(src='__STATIC__/js/ueditor/ueditor.config.js')
    script(src='__STATIC__/js/ueditor/ueditor.all.min.js')
    script.
        var editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
